package com.ht.service.impl;

import com.ht.dto.ServiceEvaluation;
import com.ht.dto.User;
import com.ht.service.ServiceEvaluationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

@Service
public class ServiceEvaluationServiceImpl implements ServiceEvaluationService {

    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public void insert(User user, ServiceEvaluation serviceEvaluation) {
        serviceEvaluation.setUserId(user.getId());
        serviceEvaluation.setUserName(user.getUsername());
        mongoTemplate.save(serviceEvaluation);
    }
}
